home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(!_root.paused && _root.sound_on)
- {
- this.turbine.setVolume(Math.abs(_root.ship_speed * 2) + 4);
- }
- else
- {
- this.turbine.setVolume(0);
- }
- if(_root.player_on && !_root.hyperspace && !_root.paused)
- {
- this._visible = true;
- if(Key.isDown(68))
- {
- if(_root.sound_on)
- {
- _root.hyperjump.start(0,1);
- }
- this.hyper_dx = Math.random() * 500 + 700;
- this.hyper_dx = Math.random() >= 0.5 ? - this.hyper_dx : this.hyper_dx;
- _root.hyper_x = _root.ToNewX(_root.ship_x,this.hyper_dx);
- _root.hyperspace = true;
- }
- if(Key.isDown(83) && _root.globalBang == 0 && _root.smartbombs > 0)
- {
- _root.globalBang = 13;
- if(_root.sound_on)
- {
- _root.smart_sfx.start(0,1);
- }
- _root.smartbombs -= 1;
- _root.bombs.gotoAndStop(_root.smartbombs + 1);
- i = 1;
- while(i < 16)
- {
- this.ship = eval("_root.ship_" + i);
- if(this.ship && this.ship._x < 550)
- {
- this.ship.Destroy(true);
- _root.EnemyAr[i] = false;
- }
- i++;
- }
- }
- if((Key.isDown(65) || Key.isDown(32)) && this.glow._currentframe == 1)
- {
- this.glow.play();
- if(_root.sound_on)
- {
- _root.pl_shot_sfx.start(0,1);
- }
- _root.attachMovie("player_shot","shot_" + this.bullets,this.bullets + 3000);
- this.bullets += 1;
- if(this.bullets > 9)
- {
- this.bullets = 0;
- }
- }
- this.flame._alpha = Math.abs(_root.ship_speed) * 5;
- this.flame._xscale = Math.abs(_root.ship_speed) * 8;
- _root.ship_x += _root.ship_speed;
- _root.ship_speed *= 0.98;
- this.to_x = (- _root.ship_speed) * 10 + 275;
- this.x = _root.ship_x + 30 + this.to_x;
- if(_root.ship_x < 0)
- {
- _root.temp_dx = _root.x_dimension % _root.ship_speed;
- _root.ship_x = _root.x_dimension - _root.temp_dx;
- }
- if(_root.ship_x > _root.x_dimension)
- {
- _root.temp_dx = _root.x_dimension % _root.ship_speed;
- _root.ship_x = _root.temp_dx;
- }
- if(Key.isDown(37))
- {
- _root.ship_speed -= 2;
- this._xscale = -100;
- }
- if(Key.isDown(39))
- {
- _root.ship_speed += 2;
- this._xscale = 100;
- }
- if(_root.ship_speed > _root.max_speed)
- {
- _root.ship_speed = _root.max_speed;
- }
- if(_root.ship_speed < - _root.max_speed)
- {
- _root.ship_speed = - _root.max_speed;
- }
- this.to_y += 12 * (Key.isDown(40) - Key.isDown(38));
- if(this.to_y > 370)
- {
- this.to_y = 370;
- }
- if(this.to_y < 80)
- {
- this.to_y = 80;
- }
- this._y -= (this._y - this.to_y) / 3;
- this._x -= (this._x - this.to_x) / 7;
- }
- else if(!_root.hyperspace && !_root.paused)
- {
- this._visible = false;
- }
- }
-